import Vue from "vue";
import VueRouter from "vue-router";

// 注册vue-router中的所有组件
Vue.use(VueRouter);

const allRouter = [
    {
        path: '/',
        redirect: "/login"
    },
    {
        path: '/login',
        component: () => import("@/view/login/LoginView.vue")
    },
    {
        path: "/main",
        component: () => import("@/view/main/MainView.vue")
    },
    {
        path: "/addr",
        component: () => import("@/view/address/AddressView.vue")
    },
    {
        path: "/order",
        component: () => import("@/view/orders/OrderView.vue")
    }
];
const router = new VueRouter({
    mode: "history",
    routes: allRouter
});

export default router;

